package com.twu.biblioteca;

import java.util.List;

public class CheckOutBook {

    public static String getCheck(MainMenu mainMenu,List<IBorrowObject> books, String in,String name){
        String msg = "That "+name+" is not available.";
        for (IBorrowObject book :books){
            if(book.getId().equals(in)&&!book.isBorrowed()){
               book.setBorrowed(true);
               msg = "Thank you! Enjoy the "+name+".";
               return msg;
            }
        }
        return  msg;
    }
}
